#ifndef _OPA_H_
#define _OPA_H_
#include "Global.h"

#define OPA0_X1()   do{_opdsw3 = 1; _opdsw4 = 1;}while(0)
#define OPA0_X20()  do{_opdsw3 = 0; _opdsw4 = 1;}while(0)
#define OPA0_X40()  do{_opdsw3 = 1; _opdsw4 = 0;}while(0)
#define OPA0_X60()  do{_opdsw3 = 0; _opdsw4 = 0;}while(0)

#define OPA1_X1()   do{_opdsw20 = 1; _opdsw21 = 1; _opdsw22 = 1; _opdsw18 = 1; _opdsw16 = 0;}while(0)
#define OPA1_X10()  do{_opdsw20 = 0; _opdsw21 = 1; _opdsw22 = 0; _opdsw18 = 0; _opdsw16 = 1;}while(0)
#define OPA1_X20()  do{_opdsw20 = 1; _opdsw21 = 0; _opdsw22 = 1;_opdsw18 = 0; _opdsw16 = 1;}while(0)
#define OPA1_X30()  do{_opdsw20 = 0; _opdsw21 = 0; _opdsw22 = 1;_opdsw18 = 1; _opdsw16 = 0;}while(0)
#define OPA1_X40()  do{_opdsw20 = 1; _opdsw21 = 1; _opdsw22 = 0;_opdsw18 = 0; _opdsw16 = 1;}while(0)
#define OPA1_X50()  do{_opdsw20 = 0; _opdsw21 = 1; _opdsw22 = 0;_opdsw18 = 0; _opdsw16 = 1;}while(0)
#define OPA1_X60()  do{_opdsw20 = 1; _opdsw21 = 0; _opdsw22 = 0;_opdsw18 = 0; _opdsw16 = 1;}while(0)
#define OPA1_X70()  do{_opdsw20 = 0; _opdsw21 = 0; _opdsw22 = 0;_opdsw18 = 0; _opdsw16 = 1;}while(0)

void CalibrateOPA0(void);
void CalibrateOPA1(void);
void initOPA0(void);
void initOPA1(void);
void initCMP(void);
#endif
